
package com.yadong.smarthome2;

import android.app.Application;
import android.content.Intent;

import com.yadong.smarthome2.control.ControlCenterService;
import com.yadong.smarthome2.device.DeviceManagerService;

public class HomeServerApplication extends Application {
    private static final Class<?> SERVICE_CLASSES[] = new Class[] {
        ControlCenterService.class,
        DeviceManagerService.class
    };

    @Override
    public void onCreate() {
        super.onCreate();
        startService();
    }

    private void startService() {
        for (Class<?> className : SERVICE_CLASSES) {
            Intent intent = new Intent(this, className);
            startService(intent);
        }
    }
}
